Modern C Up and Running by Martin Kalin

Modern C Up and Running by Martin Kalin

Author:Martin Kalin
Language: eng
Format: epub
ISBN: 9781484286760
Publisher: Apress


Through a stream, a channel that connects a source and a destination: the file could be either the source (read operation) or destination (write operation).

To study the API for the high-level I/O is, in effect, to study various ways of managing I/O streams. The forthcoming examples do so.#include <stdio.h>

#define FILE_NAME "data.in"

void main() {

float num;

printf("A floating-point value, please: ");

int how_many_floats = fscanf(stdin, "%f", &num); /* last arg must be an address */

if (how_many_floats < 1)

fprintf(stderr, "Bad scan -- probably bad characters
");

else

fprintf(stdout, "%f times 2.1 is %f
", num, num * 2.1);



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.